<%--
  Created by IntelliJ IDEA.
  User: 王志斌
  Date: 2019/2/18
  Time: 16:30
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
    String static_path = path + "/static/alpha";
    String x_admin_path = path + "/static/X-admin-2.3";
%>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>个人中心</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">

    <!-- X-admin -->
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <script type="text/javascript" src="<%=x_admin_path%>/jquery-3.2.1.min.js"></script>
    <link rel="stylesheet" href="<%=x_admin_path%>/css/font.css">
    <link rel="stylesheet" href="<%=x_admin_path%>/css/xadmin.css">
    <script type="text/javascript" src="<%=x_admin_path%>/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="<%=x_admin_path%>/js/xadmin.js"></script>
</head>
<body class="hold-transition sidebar-mini">
<div class="wrapper">
    <!-- Navbar -->
    <jsp:include page="/manage/inc/head"></jsp:include>

    <!-- Main Sidebar Container -->
    <jsp:include page="/manage/inc/sidebar"></jsp:include>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <div class="container-fluid">
                <div class="row mb-2">
                    <div class="col-sm-6">
                        <h1>个人信息</h1>
                    </div>
                    <div class="col-sm-6">
                        <ol class="breadcrumb float-sm-right">
                            <li class="breadcrumb-item"><a
                                    href="<%=path%>/manage/personal_center/personal_info">个人信息</a></li>
                            <li class="breadcrumb-item active"><a href="<%=path%>/index">首页</a></li>
                        </ol>
                    </div>
                </div>
            </div><!-- /.container-fluid -->
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-md-3">

                        <!-- Profile Image -->
                        <div class="card card-primary card-outline">
                            <div class="card-body box-profile">
                                <div class="text-center">
                                    <img class="profile-user-img img-fluid img-circle"
                                         src="<%=static_path%>/dist/img/user4-128x128.jpg"
                                         alt="User profile picture">
                                </div>

                                <h3 class="profile-username text-center">${requestScope.userinfo.name}</h3>

                                <p class="text-muted text-center">${requestScope.userinfo.jobNum}</p>

                                <ul class="list-group list-group-unbordered mb-3">
                                    <li class="list-group-item">
                                        <b>所属部门</b> <a class="float-right">${requestScope.userinfo.dt.departmentName}</a>
                                    </li>
                                    <li class="list-group-item">
                                        <b>职务</b> <a class="float-right">${requestScope.userinfo.post.postType}</a>
                                    </li>
                                    <li class="list-group-item">
                                        <b>上级领导</b> <a class="float-right">${requestScope.userinfo.leader.name}</a>
                                    </li>
                                </ul>
                            </div>
                            <!-- /.card-body -->
                        </div>
                        <!-- /.card -->

                        <!-- About Me Box -->
                        <div class="card card-primary">
                            <div class="card-header">
                                <h3 class="card-title">关于我</h3>
                            </div>
                            <!-- /.card-header -->
                            <div class="card-body">
                                <strong><i class="fa fa-book mr-1"></i>联系方式</strong>

                                <ul class="list-group list-group-unbordered mb-3">
                                    <li class="list-group-item"><p class="text-muted">${requestScope.userinfo.phone}</p></li>
                                    <li class="list-group-item"><p class="text-muted">${requestScope.userinfo.mail}</p></li>
                                </ul>

                                <strong><i class="fa fa-map-marker mr-1"></i>居住地</strong>

                                <p class="text-muted">${requestScope.userinfo.addr}</p>

                                <hr>

                                <strong><i class="fa fa-pencil mr-1"></i> 生日</strong>

                                <p class="text-muted">
                                    <span class="tag tag-danger">
                                        <fmt:formatDate value="${requestScope.userinfo.birthday}" pattern="yyyy-MM-dd"></fmt:formatDate>
                                    </span>
                                </p>

                                <hr>

                                <strong><i class="fa fa-file-text-o mr-1"></i>注册时间</strong>

                                <p class="text-muted"><fmt:formatDate value="${requestScope.userinfo.uploadTime}" pattern="yyyy-MM-dd HH:mm"></fmt:formatDate></p>
                            </div>
                            <!-- /.card-body -->
                        </div>
                        <!-- /.card -->
                    </div>
                    <!-- /.col -->
                    <div class="col-md-9">
                        <div class="card">
                            <div class="card-header p-2">
                                <ul class="nav nav-pills">
                                    <li class="nav-item"><a class="nav-link active" href="#activity" data-toggle="tab">部门规章制度</a>
                                    </li>
                                    <li class="nav-item"><a class="nav-link" href="#settings"
                                                            data-toggle="tab">修改信息</a></li>
                                </ul>
                            </div><!-- /.card-header -->
                            <div class="card-body" style="height:120%; line-height:30px;">
                                <div class="tab-content">
                                    <div class="active tab-pane" id="activity">
                                        <!-- Post -->
                                        <div class="post" id="regulationsDiv">
                                            <p style="text-indent:2em;">
                                            </p>
                                        </div>
                                        <!-- /.post -->
                                        <div id="regulationsPage" style="margin-left:20%;"></div>
                                    </div>

                                    <div class="tab-pane" id="settings">
                                        <form class="form-horizontal">
                                            <div class="form-group">
                                                <label for="inputName" class="col-sm-2 control-label">Name</label>

                                                <div class="col-sm-10">
                                                    <input type="email" class="form-control" id="inputName"
                                                           placeholder="Name">
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label for="inputEmail" class="col-sm-2 control-label">Email</label>

                                                <div class="col-sm-10">
                                                    <input type="email" class="form-control" id="inputEmail"
                                                           placeholder="Email">
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label for="inputName2" class="col-sm-2 control-label">Name</label>

                                                <div class="col-sm-10">
                                                    <input type="text" class="form-control" id="inputName2"
                                                           placeholder="Name">
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label for="inputExperience"
                                                       class="col-sm-2 control-label">Experience</label>

                                                <div class="col-sm-10">
                                                    <textarea class="form-control" id="inputExperience"
                                                              placeholder="Experience"></textarea>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label for="inputSkills" class="col-sm-2 control-label">Skills</label>

                                                <div class="col-sm-10">
                                                    <input type="text" class="form-control" id="inputSkills"
                                                           placeholder="Skills">
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <div class="col-sm-offset-2 col-sm-10">
                                                    <div class="checkbox">
                                                        <label>
                                                            <input type="checkbox"> I agree to the <a href="#">terms and
                                                            conditions</a>
                                                        </label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <div class="col-sm-offset-2 col-sm-10">
                                                    <button type="submit" class="btn btn-danger">Submit</button>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                    <!-- /.tab-pane -->
                                </div>
                                <!-- /.tab-content -->
                            </div><!-- /.card-body -->
                        </div>
                        <!-- /.nav-tabs-custom -->
                    </div>
                    <!-- /.col -->
                </div>
                <!-- /.row -->
            </div><!-- /.container-fluid -->
        </section>
        <!-- /.content -->
    </div>
    <jsp:include page="/manage/inc/foot"></jsp:include>
</div>
</body>

<script>
    layui.use('laypage', function(){
        var laypage = layui.laypage;

        //执行一个laypage实例
        laypage.render({
            elem: 'regulationsPage',
            count: ${requestScope.dataCount},
            limit:${requestScope.config.value},
            theme: '#007bff',
            jump: function(obj, first){
                var pageNo = obj.curr;
                var pageSize = obj.limit;

                $.ajax({
                    url:"<%=path%>/manage/personal_center/personal_info",
                    type:"post",
                    data:{pageNo:pageNo,pageSize:pageSize},
                    success:function (data) {
                        $("#regulationsDiv").html(data);
                    }
                });
            }
        });
    });
</script>




</html>
